package com.deyu.action;

import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.deyu.base.BaseAction;
import com.deyu.domain.Activity;
import com.deyu.domain.ActivityType;
import com.deyu.domain.Clasz;
import com.deyu.domain.Department;
import com.deyu.domain.Score;
import com.deyu.domain.Student;
import com.deyu.util.StrUtil;

@Controller
@Scope("prototype")
@SuppressWarnings("serial")
public class HomeAction extends BaseAction<Student>{
	String studentFields[] = {"id","loginName","userName","roles","currentTime",
		      "activities","clasz"};//学生字段
	String claszFields[] = {"id","title","department"};//班级字段
	String activityFields[] ={"id","name","activityType","currentTime","score","term"};//活动字段
	String activityTypeFields[] ={"id","title"};//活动类型显示字段
	String departmentFields[] = {"id","title"};//部门显示字段
	String scoreFields[] = {"id","score"};//学分字段
	List<Activity> activities;
    /**
     * 主页
     * @return
     * @throws Exception
     */
    public String show() throws Exception{
    	
    	return "index";
    }
    /**
     * 成功绑定
     * @return
     * @throws Exception
     */
    public String success() throws Exception {
    	return "success";
    }
    public String addgrade() throws Exception {
    	return "addgrade";
    }
    public  void reload() throws Exception {    	
    	Student student = getCurrentStudent();
    	StrUtil.sendJson(Student.class, studentFields, Activity.class, activityFields,ActivityType.class,activityTypeFields,Score.class,scoreFields, Clasz.class,claszFields,Department.class,departmentFields,student);

    }
    
}
